<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
</head>
<body>
      <form id="updateForm"  method="post">
        <input id="id" name="id" type="hidden"/>
		<table class="add-user">
			<tr>
				<td class="m-info-title">
					车牌号:
				</td>
				<td class="m-info-content">
					<input style="width: 150px; height: 23px;" name="chepaihao"  id="chepaihao" />
				</td>
			</tr>
			<tr>
				<td class="m-info-title">
					车型:
				</td>
				<td class="m-info-content">
					<input style="width: 150px; height: 23px;" name="chexing"  id="chexing" />
				</td>
			</tr>
			<tr>
				<td class="m-info-title">
					最大体积:
				</td>
				<td class="m-info-content">
					<input style="width: 150px; height: 23px;" name="zuidatiji"  id="zuidatiji" />
				</td>
			</tr>
			<tr>
				<td class="m-info-title">
					载重:
				</td>
				<td class="m-info-content">
					<input style="width: 150px; height: 23px;" name="zaizhong"  id="zaizhong" />
				</td>
			</tr>
			<tr>
				<td class="m-info-title">
					载人数:
				</td>
				<td class="m-info-content">
					<input style="width: 150px; height: 23px;" name="zairen"  id="zairen" />
				</td>
			</tr>
			<tr>
				<td class="m-info-title">
					准驾驾照:
				</td>
				<td class="m-info-content">
					<input style="width: 150px; height: 23px;" name="jiazhao"  id="jiazhao" />
				</td>
			</tr>
			<tr>
				<td class="m-info-title">
					是否可用:
				</td>
				<td class="m-info-content">
					<input style="width: 150px; height: 23px;" name="zhuangtai"  id="zhuangtai" />
				</td>
			</tr>
			<tr>
				<td class="m-info-title">
					备注:
				</td>
				<td class="m-info-content">
					<input style="width: 150px; height: 23px;" name="beizhu"  id="beizhu" />
				</td>
			</tr>
			<tr>
				<td class="m-info-title">
					默认司机 :
				</td>
				<td class="m-info-content">
					<input style="width: 150px; height: 23px;" name="username" id="username" />
				</td>
			</tr>
			<tr>
				<td class="m-info-title">
					GPS :
				</td>
				<td class="m-info-content">
					<input style="width: 150px; height: 23px;" name="gpsid" id="gpsid" />
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<div class="Mbutton25 createButton" id="saveButton">保存</div>
				</td>
		    </tr>
		</table>
	</form>
	
	<script type="text/javascript">
       $(function(){
    	   /* 文本框显示部分 */
    	   var rows = $('#produceLabelTable').datagrid("getSelections");
    	   $("#id").val(rows[0].id);
    	   $("#chepaihao").val(rows[0].chepaihao);
		   $("#chexing").val(rows[0].chexing);
		   $("#zuidatiji").val(rows[0].zuidatiji);
		   $("#zaizhong").val(rows[0].zaizhong);
		   $("#zairen").val(rows[0].zairen);
		   $("#jiazhao").val(rows[0].jiazhao);
		   $("#zhuangtai").val(rows[0].zhuangtai);
		   $("#beizhu").val(rows[0].beizhu);
		   $("#username").val(rows[0].username);
		   $("#gpsid").val(rows[0].gpsid);
    	   

    	   
    	   $("#saveButton").click(function() {
	   			
	  			if ($("#updateForm").form("validate")) {
	  				var params = $("#updateForm").serialize();
	  				$('#updateForm').mask();
	  				$.ajax({
	  					type : "POST",
	  					url :  "/adCheliang/updateCheliang",
	  					data : params,
	  					success : function(response) {
	  						if (response=="success") 
	  						{  
	  							$('#updateForm').mask("hide");
	  							$.messager.alert('提示', '修改成功', 'info', function() {
	  								$("#addwindom").window('close');
	  								$('#produceLabelTable').datagrid('reload');
	  								$('#produceLabelTable').datagrid('clearSelections');
	  							});
	  							
	  						}else{
	  							$('#updateForm').mask("hide");
	  							$.messager.alert('提示', '修改失败，'+response, 'error', function() {});
	  						}
	  					},
	  					error : function() 
	  					{
	  						$('#updateForm').mask("hide");
	  						$.messager.alert('提示', '修改失败', 'error', function() {});
	  					}
	  				});
	  			}  
 		   });
       })
     
	</script>
</body>
</html>

